package org.example.datasource;

public class SubjectContext {
    private static final ThreadLocal<String> CURRENT_TENANT = new ThreadLocal<>();

    public static void setDataSourceKey(String dataSourceKey) {
        CURRENT_TENANT.set(dataSourceKey);
    }

    public static String getDataSourceKey() {
        return CURRENT_TENANT.get();
    }

    public static void clear() {
        CURRENT_TENANT.remove();
    }
}
